home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / scitech / mvis01 / source / tlist.cpp < prev    next >
Encoding:
Text File  |  1994-03-10  |  33.4 KB  |  1,107 lines

  1. indVesaMode(xsize,ysize,24);
  2.     END;
  3.     IF mode = 0 THEN BEGIN
  4.         WriteLn('No such mode could be found !');
  5.         WriteLn('Switching to to 320x200.');
  6.         ReadKey;
  7.         mode := V320x200x256;
  8.     END;
  9. END;
  10.  
  11. begin { program body }
  12.   SelectMode;
  13.   Initialize;
  14.   ReportStatus;
  15.  
  16. {  AspectRatioPlay; }
  17.   FillEllipsePlay;
  18.   SectorPlay;
  19.   WriteModePlay;
  20.  
  21.   ColorPlay;
  22.   { PalettePlay only intended to work on these drivers: }
  23.   if (GraphDriver = EGA) or
  24.       (GraphDriver = EGA64) or
  25.       (GraphDriver = VGA) then
  26.      PalettePlay;
  27.   PutPixelPlay;
  28. {  PutImagePlay; }
  29.   RandBarPlay;
  30.   BarPlay;
  31.   Bar3DPlay;
  32.   ArcPlay;
  33.   CirclePlay;
  34.   PiePlay;
  35.   LineToPlay;
  36.   LineRelPlay;
  37. {  LineStylePlay; }
  38. {  UserLineStylePlay; }
  39.   TextDump;
  40.   TextPlay;
  41.   CrtModePlay;
  42.   FillStylePlay;
  43.   FillPatternPlay;
  44.   PolyPlay;
  45.   SayGoodbye;
  46. {  CloseGraph; }
  47.   CloseVesa;
  48. end.
  49. ***************************************************
  50.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  51.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  52. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  53. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  54.     Color := RandColor;
  55.     SetColor(Color);
  56.     SetFillStyle(Random(CloseDotFill)+1, Color);
  57.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  58.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  59.   until KeyPressed;
  60.   WaitToGo;
  61. end; { RandBarPlay }
  62.  
  63. procedure ArcPlay;
  64. { Draw random arcs on the screen }
  65. var
  66.   MaxRadius : word;
  67.   EndAngle : word;
  68.   ArcInfo : ArcCoordsType;
  69. begin
  70.   MainWindow('Arc / GetArcCoords demonstration');
  71.   StatusLine('Esc aborts or press a key');
  72.   MaxRadius := MaxY div 10;
  73.   repeat
  74.     SetColor(RandColor);
  75.     EndAngle := Random(360);
  76.     SetLineStyle(SolidLn, 0, NormWidth);
  77.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  78.     GetArcCoords(ArcInfo);
  79.     with ArcInfo do
  80.     begin
  81.       Line(X, Y, XStart, YStart);
  82.       Line(X, Y, Xend, Yend);
  83.     end;
  84.   until KeyPressed;
  85.   WaitToGo;
  86. end; { ArcPlay }
  87.  
  88. procedure PutPixelPlay;
  89. { Demonstrate the PutPixel and GetPixel commands }
  90. const
  91.   Seed   = 1962; { A seed for the random number generator }
  92.   NumPts = 2000; { The number of pixels plotted }
  93.   Esc    = #27;
  94. var
  95.   I : word;
  96.   X, Y, Color : word;
  97.   XMax, YMax  : integer;
  98.   ViewInfo    : ViewPortType;
  99. begin
  100.   MainWindow('PutPixel / GetPixel demonstration');
  101.   StatusLine('Esc aborts or press a key...');
  102.  
  103.   GetViewSettings(ViewInfo);
  104.   with ViewInfo do
  105.   begin
  106.     XMax := (x2-x1-1);
  107.     YMax := (y2-y1-1);
  108.   end;
  109.  
  110.   while not KeyPressed do
  111.   begin
  112.     { Plot random pixels }
  113.     RandSeed := Seed;
  114.     I := 0;
  115.     while (not KeyPressed) and (I < NumPts) do
  116.     begin
  117.       Inc(I);
  118.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  119.     end;
  120.  
  121.     { Erase pixels }
  122.     RandSeed := Seed;
  123.     I := 0;
  124.     while (not KeyPressed) and (I < NumPts) do
  125.     begin
  126.       Inc(I);
  127.       X := Random(XMax)+1;
  128.       Y := Random(YMax)+1;
  129.       Color := GetPixel(X, Y);
  130.         if Color = RandColor then
  131.           PutPixel(X, Y, 0);
  132.      end;
  133.   end;
  134.   WaitToGo;
  135. end; { PutPixelPlay }
  136.  
  137. procedure PutImagePlay;
  138. { Demonstrate the GetImage and PutImage commands }
  139.  
  140. const
  141.   r  = 20;
  142.   StartX = 100;
  143.   StartY = 50;
  144.  
  145. var
  146.   CurPort : ViewPortType;
  147.  
  148. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  149. var
  150.   Step : integer;
  151. begin
  152.   Step := Random(2*r);
  153.   if Odd(Step) then
  154.     Step := -Step;
  155.   X := X + Step;
  156.   Step := Random(r);
  157.   if Odd(Step) then
  158.     Step := -Step;
  159.   Y := Y + Step;
  160.  
  161.   { Make saucer bounce off viewport walls }
  162.   with CurPort do
  163.   begin
  164.     if (x1 + X + Width - 1 > x2) then
  165.       X := x2-x1 - Width + 1
  166.     else
  167.       if (X < 0) then
  168.         X := 0;
  169.     if (y1 + Y + Height - 1 > y2) then
  170.       Y := y2-y1 - Height + 1
  171.     else
  172.       if (Y < 0) then
  173.         Y := 0;
  174.   end;
  175. end; { MoveSaucer }
  176.  
  177. var
  178.   Pausetime : word;
  179.   Saucer    : pointer;
  180.   X, Y      : integer;
  181.   ulx, uly  : word;
  182.   lrx, lry  : word;
  183.   Size      : word;
  184.   I         : word;
  185. begin
  186.   ClearDevice;
  187.   FullPort;
  188.  
  189.   { PaintScreen }
  190.   ClearDevice;
  191.   MainWindow('GetImage / PutImage Demonstration');
  192.   StatusLine('Esc aborts or press a key...');
  193.   GetViewSettings(CurPort);
  194.  
  195.   { DrawSaucer }
  196.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  197.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  198.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  199.   Circle(StartX+10, StartY-12, 2);
  200.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  201.   Circle(StartX-10, StartY-12, 2);
  202.   SetFillStyle(SolidFill, MaxColor);
  203.   FloodFill(StartX+1, StartY+4, GetColor);
  204.  
  205.   { ReadSaucerImage }
  206.   ulx := StartX-(r+1);
  207.   uly := StartY-14;
  208.   lrx := StartX+(r+1);
  209.   lry := StartY+(r div 3)+3;
  210.  
  211.   Size := ImageSize(ulx, uly, lrx, lry);
  212.   GetMem(Saucer, Size);
  213.   GetImage(ulx, uly, lrx, lry, Saucer^);
  214. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  215.  
  216.   { Plot some "stars" }
  217.   for I := 1 to 1000 do
  218.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  219.   X := MaxX div 2;
  220.   Y := MaxY div 2;
  221.   PauseTime := 70;
  222.  
  223.   { Move the saucer around }
  224.   repeat
  225. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  226.      Delay(PauseTime);
  227. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  228.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  229.   until KeyPressed;
  230.   FreeMem(Saucer, size);
  231.   WaitToGo;
  232. end; { PutImagePlay }
  233.  
  234. procedure PolyPlay;
  235. { Draw random polygons with random fill styles on the screen }
  236. const
  237.   MaxPts = 5;
  238. type
  239.   PolygonType = array[1..MaxPts] of PointType;
  240. var
  241.   Poly : PolygonType;
  242.   I, Color : word;
  243. begin
  244.   MainWindow('FillPoly demonstration');
  245.   StatusLine('Esc aborts or press a key...');
  246.   repeat
  247.     Color := RandColor;
  248.     SetFillStyle(Random(11)+1, Color);
  249.     SetColor(Color);
  250.     for I := 1 to MaxPts do
  251.       with Poly[I] do
  252.       begin
  253.         X := Random(MaxX);
  254.         Y := Random(MaxY);
  255.       end;
  256.     FillPoly(MaxPts, Poly);
  257.   until KeyPressed;
  258.   WaitToGo;
  259. end; { PolyPlay }
  260.  
  261. procedure FillStylePlay;
  262. { Display all of the predefined fill styles available }
  263. var
  264.   Style    : word;
  265.   Width    : word;
  266.   Height   : word;
  267.   X, Y     : word;
  268.   I, J     : word;
  269.   ViewInfo : ViewPortType;
  270.  
  271. procedure DrawBox(X, Y : word);
  272. begin
  273.   SetFillStyle(Style, MaxColor);
  274.   with ViewInfo do
  275.     Bar(X, Y, X+Width, Y+Height);
  276.   Rectangle(X, Y, X+Width, Y+Height);
  277.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  278.   Inc(Style);
  279. end; { DrawBox }
  280.  
  281. begin
  282.   MainWindow('Pre-defined fill styles');
  283.   GetViewSettings(ViewInfo);
  284.   with ViewInfo do
  285.   begin
  286.     Width := 2 * ((x2+1) div 13);
  287.     Height := 2 * ((y2-10) div 10);
  288.   end;
  289.   X := Width div 2;
  290.   Y := Height div 2;
  291.   Style := 0;
  292.   for J := 1 to 3 do
  293.   begin
  294.     for I := 1 to 4 do
  295.     begin
  296.       DrawBox(X, Y);
  297.       Inc(X, (Width div 2) * 3);
  298.     end;
  299.     X := Width div 2;
  300.     Inc(Y, (Height div 2) * 3);
  301.   end;
  302.   SetTextJustify(LeftText, TopText);
  303.   WaitToGo;
  304. end; { FillStylePlay }
  305.  
  306. procedure FillPatternPlay;
  307. { Display some user defined fill patterns }
  308. const
  309.   Patterns : array[0..11] of FillPatternType = (
  310.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  311.             OldColor which has a path of pixels of OldColor or NewColor
  312.             with sides touching back to the seed point, (XSeed, YSeed).
  313.             Therefore, only pixels of OldColor are modified and no other
  314.             information is changed.
  315.  
  316.             SEE ALSO
  317.  
  318.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  319.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  320.             SETVIEW
  321.  
  322.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  323.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  324.             IF WHICHVGA = 0 THEN STOP
  325.             DUMMY=RES640
  326.             SETVIEW 100, 100, 539, 379
  327.             FILLVIEW 10
  328.             WHILE INKEY$ = ""
  329.             WEND
  330.             VIDEOMODESET VMODE
  331.             END
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.                                                                          63
  349.  
  350.  
  351.  
  352.  
  353.  
  354.           FONTGETINFO
  355.  
  356.             PROTOTYPE
  357.  
  358.             SUB FONTGETINFO (Width%, Height%)
  359.  
  360.             INPUT
  361.  
  362.             no input parameters
  363.     WEND
  364.             MOUSEEXIT
  365.             VIDEOMODESET VMODE
  366.             END
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.                                                                          86
  408.  
  409.  
  410.  
  411.  
  412.  
  413.           MOUSECURSORDEFAULT
  414.  
  415.             PROTOTYPE
  416.  
  417.             SUB MOUSECURSORDEFAULT ()
  418.  
  419.             INPUT
  420.  
  421.             no input parameters
  422.  
  423.             OUTPUT
  424.  
  425.             no value returned
  426.  
  427.             USAGE
  428.  
  429.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  430.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  431. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  432. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  433. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  434. $╤
  435. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  436. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  437. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  438.       end;
  439.     end;
  440.   end;
  441.   WaitToGo;
  442. end; { UserLineStylePlay }
  443.  
  444.  
  445. procedure SayGoodbye;
  446. { Say goodbye and then exit the program }
  447. var
  448.   ViewInfo : ViewPortType;
  449. begin
  450.   MainWindow('');
  451.   GetViewSettings(ViewInfo);
  452.   SetTextStyle(TriplexFont, HorizDir, 4);
  453.   SetTextJustify(CenterText, CenterText);
  454.   with ViewInfo do
  455.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  456.   StatusLine('Press any key to quit...');
  457.   repeat until KeyPressed;
  458. end; { SayGoodbye }
  459.  
  460.  
  461. PROCEDURE SelectMode;
  462. VAR
  463.     choice1,choice2     : CHAR;
  464.    xsize,ysize            : WORD;
  465. BEGIN
  466.     (* Let's select a mode *)
  467.     ClrScr;
  468.     WriteLn('VESADEMO:');
  469.     WriteLn('1. 256 colors');
  470.     WriteLn('2. 32768 colors');
  471.     WriteLn('3. 65536 colors');
  472.     WriteLn('4. 16777216 colors');
  473.     WriteLn('Q uit');
  474.     WriteLn;
  475.     Write('Your choice: ');
  476.     REPEAT
  477.         ReadLn(choice1);
  478.       IF choice1 <> '1' THEN BEGIN
  479.           WriteLn('Sorry !');
  480.          WriteLn('This demo wasn''t written for more as 256 colors !');
  481.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  482.          WriteLn('Switching to 256 colors.');
  483.          choice1 := '1';
  484.       END;
  485.     UNTIL choice1 IN ['1'..'4','q'];
  486.     IF choice1 = 'q' THEN Halt;
  487.  
  488.     WriteLn;
  489.     WriteLn;
  490.     WriteLn('a. 320x200');
  491.     WriteLn('b. 640x480');
  492.     WriteLn('c. 800x600');
  493.     WriteLn('d. 1024x768');
  494.     WriteLn('e. 1280x1024');
  495.     WriteLn('Q uit');
  496.     WriteLn;
  497.     Write('Your choice: ');
  498.     REPEAT
  499.         ReadLn(choice2);
  500.     UNTIL choice2 IN ['a'..'e','q'];
  501.     IF choice2 = 'q' THEN Halt;
  502.  
  503.     CASE choice2 OF
  504.         'a' : BEGIN
  505.             xsize := 320;
  506.             ysize := 200;
  507.         END;
  508.         'b' : BEGIN
  509.             xsize := 640;
  510.             ysize := 480;
  511.         END;
  512.         'c' : BEGIN
  513.             xsize := 800;
  514.             ysize := 600;
  515.         END;
  516.         'd' : BEGIN
  517.             xsize := 1024;
  518.             ysize := 768;
  519.         END;
  520.         'e' : BEGIN
  521.             xsize := 1280;
  522.             ysize := 1024;
  523.         END;
  524.     END;
  525.     CASE choice1 OF
  526.         '1' : mode := FindVesaMode(xsize,ysize,8);
  527.         '2' : mode := FindVesaMode(xsize,ysize,15);
  528.         '3' : mode := FindVesaMode(xsize,ysize,16);
  529.         '4' : mode := FindVesaMode(xsize,ysize,24);
  530.     END;
  531.     IF mode = 0 THEN BEGIN
  532.         WriteLn('No such mode could be found !');
  533.         WriteLn('Switching to to 320x200.');
  534.         ReadKey;
  535.         mode := V320x200x256;
  536.     END;
  537. END;
  538.  
  539. begin { program body }
  540.   SelectMode;
  541.   Initialize;
  542.   ReportStatus;
  543.  
  544. {  AspectRatioPlay; }
  545.   FillEllipsePlay;
  546.   SectorPlay;
  547.   WriteModePlay;
  548.  
  549.   ColorPlay;
  550.   { PalettePlay only intended to work on these drivers: }
  551.   if (GraphDriver = EGA) or
  552.       (GraphDriver = EGA64) or
  553.       (GraphDriver = VGA) then
  554.      PalettePlay;
  555.   PutPixelPlay;
  556. {  PutImagePlay; }
  557.   RandBarPlay;
  558.   BarPlay;
  559.   Bar3DPlay;
  560.   ArcPlay;
  561.   CirclePlay;
  562.   PiePlay;
  563.   LineToPlay;
  564.   LineRelPlay;
  565. {  LineStylePlay; }
  566. {  UserLineStylePlay; }
  567.   TextDump;
  568.   TextPlay;
  569.   CrtModePlay;
  570.   FillStylePlay;
  571.   FillPatternPlay;
  572.   PolyPlay;
  573.   SayGoodbye;
  574. {  CloseGraph; }
  575.   CloseVesa;
  576. end.
  577. ***************************************************
  578.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  579.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  580. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  581. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  582.     Color := RandColor;
  583.     SetColor(Color);
  584.     SetFillStyle(Random(CloseDotFill)+1, Color);
  585.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  586.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  587.   until KeyPressed;
  588.   WaitToGo;
  589. end; { RandBarPlay }
  590.  
  591. procedure ArcPlay;
  592. { Draw random arcs on the screen }
  593. var
  594.   MaxRadius : word;
  595.   EndAngle : word;
  596.   ArcInfo : ArcCoordsType;
  597. begin
  598.   MainWindow('Arc / GetArcCoords demonstration');
  599.   StatusLine('Esc aborts or press a key');
  600.   MaxRadius := MaxY div 10;
  601.   repeat
  602.     SetColor(RandColor);
  603.     EndAngle := Random(360);
  604.     SetLineStyle(SolidLn, 0, NormWidth);
  605.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  606.     GetArcCoords(ArcInfo);
  607.     with ArcInfo do
  608.     begin
  609.       Line(X, Y, XStart, YStart);
  610.       Line(X, Y, Xend, Yend);
  611.     end;
  612.   until KeyPressed;
  613.   WaitToGo;
  614. end; { ArcPlay }
  615.  
  616. procedure PutPixelPlay;
  617. { Demonstrate the PutPixel and GetPixel commands }
  618. const
  619.   Seed   = 1962; { A seed for the random number generator }
  620.   NumPts = 2000; { The number of pixels plotted }
  621.   Esc    = #27;
  622. var
  623.   I : word;
  624.   X, Y, Color : word;
  625.   XMax, YMax  : integer;
  626.   ViewInfo    : ViewPortType;
  627. begin
  628.   MainWindow('PutPixel / GetPixel demonstration');
  629.   StatusLine('Esc aborts or press a key...');
  630.  
  631.   GetViewSettings(ViewInfo);
  632.   with ViewInfo do
  633.   begin
  634.     XMax := (x2-x1-1);
  635.     YMax := (y2-y1-1);
  636.   end;
  637.  
  638.   while not KeyPressed do
  639.   begin
  640.     { Plot random pixels }
  641.     RandSeed := Seed;
  642.     I := 0;
  643.     while (not KeyPressed) and (I < NumPts) do
  644.     begin
  645.       Inc(I);
  646.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  647.     end;
  648.  
  649.     { Erase pixels }
  650.     RandSeed := Seed;
  651.     I := 0;
  652.     while (not KeyPressed) and (I < NumPts) do
  653.     begin
  654.       Inc(I);
  655.       X := Random(XMax)+1;
  656.       Y := Random(YMax)+1;
  657.       Color := GetPixel(X, Y);
  658.         if Color = RandColor then
  659.           PutPixel(X, Y, 0);
  660.      end;
  661.   end;
  662.   WaitToGo;
  663. end; { PutPixelPlay }
  664.  
  665. procedure PutImagePlay;
  666. { Demonstrate the GetImage and PutImage commands }
  667.  
  668. const
  669.   r  = 20;
  670.   StartX = 100;
  671.   StartY = 50;
  672.  
  673. var
  674.   CurPort : ViewPortType;
  675.  
  676. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  677. var
  678.   Step : integer;
  679. begin
  680.   Step := Random(2*r);
  681.   if Odd(Step) then
  682.     Step := -Step;
  683.   X := X + Step;
  684.   Step := Random(r);
  685.   if Odd(Step) then
  686.     Step := -Step;
  687.   Y := Y + Step;
  688.  
  689.   { Make saucer bounce off viewport walls }
  690.   with CurPort do
  691.   begin
  692.     if (x1 + X + Width - 1 > x2) then
  693.       X := x2-x1 - Width + 1
  694.     else
  695.       if (X < 0) then
  696.         X := 0;
  697.     if (y1 + Y + Height - 1 > y2) then
  698.       Y := y2-y1 - Height + 1
  699.     else
  700.       if (Y < 0) then
  701.         Y := 0;
  702.   end;
  703. end; { MoveSaucer }
  704.  
  705. var
  706.   Pausetime : word;
  707.   Saucer    : pointer;
  708.   X, Y      : integer;
  709.   ulx, uly  : word;
  710.   lrx, lry  : word;
  711.   Size      : word;
  712.   I         : word;
  713. begin
  714.   ClearDevice;
  715.   FullPort;
  716.  
  717.   { PaintScreen }
  718.   ClearDevice;
  719.   MainWindow('GetImage / PutImage Demonstration');
  720.   StatusLine('Esc aborts or press a key...');
  721.   GetViewSettings(CurPort);
  722.  
  723.   { DrawSaucer }
  724.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  725.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  726.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  727.   Circle(StartX+10, StartY-12, 2);
  728.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  729.   Circle(StartX-10, StartY-12, 2);
  730.   SetFillStyle(SolidFill, MaxColor);
  731.   FloodFill(StartX+1, StartY+4, GetColor);
  732.  
  733.   { ReadSaucerImage }
  734.   ulx := StartX-(r+1);
  735.   uly := StartY-14;
  736.   lrx := StartX+(r+1);
  737.   lry := StartY+(r div 3)+3;
  738.  
  739.   Size := ImageSize(ulx, uly, lrx, lry);
  740.   GetMem(Saucer, Size);
  741.   GetImage(ulx, uly, lrx, lry, Saucer^);
  742. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  743.  
  744.   { Plot some "stars" }
  745.   for I := 1 to 1000 do
  746.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  747.   X := MaxX div 2;
  748.   Y := MaxY div 2;
  749.   PauseTime := 70;
  750.  
  751.   { Move the saucer around }
  752.   repeat
  753. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  754.      Delay(PauseTime);
  755. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  756.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  757.   until KeyPressed;
  758.   FreeMem(Saucer, size);
  759.   WaitToGo;
  760. end; { PutImagePlay }
  761.  
  762. procedure PolyPlay;
  763. { Draw random polygons with random fill styles on the screen }
  764. const
  765.   MaxPts = 5;
  766. type
  767.   PolygonType = array[1..MaxPts] of PointType;
  768. var
  769.   Poly : PolygonType;
  770.   I, Color : word;
  771. begin
  772.   MainWindow('FillPoly demonstration');
  773.   StatusLine('Esc aborts or press a key...');
  774.   repeat
  775.     Color := RandColor;
  776.     SetFillStyle(Random(11)+1, Color);
  777.     SetColor(Color);
  778.     for I := 1 to MaxPts do
  779.       with Poly[I] do
  780.       begin
  781.         X := Random(MaxX);
  782.         Y := Random(MaxY);
  783.       end;
  784.     FillPoly(MaxPts, Poly);
  785.   until KeyPressed;
  786.   WaitToGo;
  787. end; { PolyPlay }
  788.  
  789. procedure FillStylePlay;
  790. { Display all of the predefined fill styles available }
  791. var
  792.   Style    : word;
  793.   Width    : word;
  794.   Height   : word;
  795.   X, Y     : word;
  796.   I, J     : word;
  797.   ViewInfo : ViewPortType;
  798.  
  799. procedure DrawBox(X, Y : word);
  800. begin
  801.   SetFillStyle(Style, MaxColor);
  802.   with ViewInfo do
  803.     Bar(X, Y, X+Width, Y+Height);
  804.   Rectangle(X, Y, X+Width, Y+Height);
  805.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  806.   Inc(Style);
  807. end; { DrawBox }
  808.  
  809. begin
  810.   MainWindow('Pre-defined fill styles');
  811.   GetViewSettings(ViewInfo);
  812.   with ViewInfo do
  813.   begin
  814.     Width := 2 * ((x2+1) div 13);
  815.     Height := 2 * ((y2-10) div 10);
  816.   end;
  817.   X := Width div 2;
  818.   Y := Height div 2;
  819.   Style := 0;
  820.   for J := 1 to 3 do
  821.   begin
  822.     for I := 1 to 4 do
  823.     begin
  824.       DrawBox(X, Y);
  825.       Inc(X, (Width div 2) * 3);
  826.     end;
  827.     X := Width div 2;
  828.     Inc(Y, (Height div 2) * 3);
  829.   end;
  830.   SetTextJustify(LeftText, TopText);
  831.   WaitToGo;
  832. end; { FillStylePlay }
  833.  
  834. procedure FillPatternPlay;
  835. { Display some user defined fill patterns }
  836. const
  837.   Patterns : array[0..11] of FillPatternType = (
  838.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  839.             OldColor which has a path of pixels of OldColor or NewColor
  840.             with sides touching back to the seed point, (XSeed, YSeed).
  841.             Therefore, only pixels of OldColor are modified and no other
  842.             information is changed.
  843.  
  844.             SEE ALSO
  845.  
  846.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  847.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  848.             SETVIEW
  849.  
  850.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  851.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  852.             IF WHICHVGA = 0 THEN STOP
  853.             DUMMY=RES640
  854.             SETVIEW 100, 100, 539, 379
  855.             FILLVIEW 10
  856.             WHILE INKEY$ = ""
  857.             WEND
  858.             VIDEOMODESET VMODE
  859.             END
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.                                                                          63
  877.  
  878.  
  879.  
  880.  
  881.  
  882.           FONTGETINFO
  883.  
  884.             PROTOTYPE
  885.  
  886.             SUB FONTGETINFO (Width%, Height%)
  887.  
  888.             INPUT
  889.  
  890.             no input parameters
  891.     WEND
  892.             MOUSEEXIT
  893.             VIDEOMODESET VMODE
  894.             END
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.                                                                          86
  936.  
  937.  
  938.  
  939.  
  940.  
  941.           MOUSECURSORDEFAULT
  942.  
  943.             PROTOTYPE
  944.  
  945.             SUB MOUSECURSORDEFAULT ()
  946.  
  947.             INPUT
  948.  
  949.             no input parameters
  950.  
  951.             OUTPUT
  952.  
  953.             no value returned
  954.  
  955.             USAGE
  956.  
  957.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  958.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  959. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  960. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  961. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  962. $╤
  963. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  964. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  965. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  966.       end;
  967.     end;
  968.   end;
  969.   WaitToGo;
  970. end; { UserLineStylePlay }
  971.  
  972.  
  973. procedure SayGoodbye;
  974. { Say goodbye and then exit the program }
  975. var
  976.   ViewInfo : ViewPortType;
  977. begin
  978.   MainWindow('');
  979.   GetViewSettings(ViewInfo);
  980.   SetTextStyle(TriplexFont, HorizDir, 4);
  981.   SetTextJustify(CenterText, CenterText);
  982.   with ViewInfo do
  983.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  984.   StatusLine('Press any key to quit...');
  985.   repeat until KeyPressed;
  986. end; { SayGoodbye }
  987.  
  988.  
  989. PROCEDURE SelectMode;
  990. VAR
  991.     choice1,choice2     : CHAR;
  992.    xsize,ysize            : WORD;
  993. BEGIN
  994.     (* Let's select a mode *)
  995.     ClrScr;
  996.     WriteLn('VESADEMO:');
  997.     WriteLn('1. 256 colors');
  998.     WriteLn('2. 32768 colors');
  999.     WriteLn('3. 65536 colors');
  1000.     WriteLn('4. 16777216 colors');
  1001.     WriteLn('Q uit');
  1002.     WriteLn;
  1003.     Write('Your choice: ');
  1004.     REPEAT
  1005.         ReadLn(choice1);
  1006.       IF choice1 <> '1' THEN BEGIN
  1007.           WriteLn('Sorry !');
  1008.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1009.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1010.          WriteLn('Switching to 256 colors.');
  1011.          choice1 := '1';
  1012.       END;
  1013.     UNTIL choice1 IN ['1'..'4','q'];
  1014.     IF choice1 = 'q' THEN Halt;
  1015.  
  1016.     WriteLn;
  1017.     WriteLn;
  1018.     WriteLn('a. 320x200');
  1019.     WriteLn('b. 640x480');
  1020.     WriteLn('c. 800x600');
  1021.     WriteLn('d. 1024x768');
  1022.     WriteLn('e. 1280x1024');
  1023.     WriteLn('Q uit');
  1024.     WriteLn;
  1025.     Write('Your choice: ');
  1026.     REPEAT
  1027.         ReadLn(choice2);
  1028.     UNTIL choice2 IN ['a'..'e','q'];
  1029.     IF choice2 = 'q' THEN Halt;
  1030.  
  1031.     CASE choice2 OF
  1032.         'a' : BEGIN
  1033.             xsize := 320;
  1034.             ysize := 200;
  1035.         END;
  1036.         'b' : BEGIN
  1037.             xsize := 640;
  1038.             ysize := 480;
  1039.         END;
  1040.         'c' : BEGIN
  1041.             xsize := 800;
  1042.             ysize := 600;
  1043.         END;
  1044.         'd' : BEGIN
  1045.             xsize := 1024;
  1046.             ysize := 768;
  1047.         END;
  1048.         'e' : BEGIN
  1049.             xsize := 1280;
  1050.             ysize := 1024;
  1051.         END;
  1052.     END;
  1053.     CASE choice1 OF
  1054.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1055.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1056.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1057.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1058.     END;
  1059.     IF mode = 0 THEN BEGIN
  1060.         WriteLn('No such mode could be found !');
  1061.         WriteLn('Switching to to 320x200.');
  1062.         ReadKey;
  1063.         mode := V320x200x256;
  1064.     END;
  1065. END;
  1066.  
  1067. begin { program body }
  1068.   SelectMode;
  1069.   Initialize;
  1070.   ReportStatus;
  1071.  
  1072. {  AspectRatioPlay; }
  1073.   FillEllipsePlay;
  1074.   SectorPlay;
  1075.   WriteModePlay;
  1076.  
  1077.   ColorPlay;
  1078.   { PalettePlay only intended to work on these drivers: }
  1079.   if (GraphDriver = EGA) or
  1080.       (GraphDriver = EGA64) or
  1081.       (GraphDriver = VGA) then
  1082.      PalettePlay;
  1083.   PutPixelPlay;
  1084. {  PutImagePlay; }
  1085.   RandBarPlay;
  1086.   BarPlay;
  1087.   Bar3DPlay;
  1088.   ArcPlay;
  1089.   CirclePlay;
  1090.   PiePlay;
  1091.   LineToPlay;
  1092.   LineRelPlay;
  1093. {  LineStylePlay; }
  1094. {  UserLineStylePlay; }
  1095.   TextDump;
  1096.   TextPlay;
  1097.   CrtModePlay;
  1098.   FillStylePlay;
  1099.   FillPatternPlay;
  1100.   PolyPlay;
  1101.   SayGoodbye;
  1102. {  CloseGraph; }
  1103.   CloseVesa;
  1104. end.
  1105. ***************************************************
  1106.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  1107.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡